﻿<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>无标题文档</title>
    <link href="/xiaozu/css/main.css" rel="stylesheet" type="text/css" />
    <script>
        function toSubmit(){
            let formData = new FormData($("#myForm")[0]);
            //alert("123");
            //alert(formData);
            //console.log(formData);
            $.ajax({
                type:'post',
                data:formData,
                dataType: "json",
                contentType:false,
                processData:false,
                async: false,cache: false,
                url:'${pageContext.request.contextPath}/store/add.do',
                success:function(msg){
                    // opener.layer.close('myAdd')
                    // console.log(opener.openlayer)
                    window.parent.layer.closeAll()
                }
            })
        }
    </script>
</head>
<body>
<h1 class="h1_style"><i class="i_h1"></i>店铺信息</h1>
<form id="myForm" action="${pageContext.request.contextPath}/store/add.do" method="post" enctype="multipart/form-data">
<div class="div_left">
        <p class="form_p"><label class="form_label">店铺名称：</label><input type="text" name="ss_shop_Store" value="${store.ss_shop_Store}" class="form_input " minlength="2"  required ><i class="i_start"></i> </p>
        <p class="form_p"><label class="form_label">类型：</label>
            <select name="ss_shop_Type"  value="${store.ss_shop_Type}"class="form_select" style="padding-left: 1%;">
                <option value="1" <c:if test="${ss_shop_Type == 1}">selected="selected"</c:if>>餐饮</option>
                <option value="2" <c:if test="${ss_shop_Type == 2}">selected="selected"</c:if>>家居建材</option>
                <option value="2" <c:if test="${ss_shop_Type == 3}">selected="selected"</c:if>>饰品</option>
                <option>无</option>
            </select>
        </p>
        <p class="form_p"><label class="form_label">责任人：</label>
            <input name="ss_shop_Person" value="${store.ss_shop_Person}" type="text" class="form_input " minlength="2"  required ><i class="i_start"></i></p>
        <p class="form_p"><label class="form_label">责任人身份证号码：</label>
            <input name="ss_shop_IDcard" value="${store.ss_shop_IDcard}" type="text" class="form_input " minlength="2"  required ><i class="i_start"></i></p>
        <p class="form_p"><label class="form_label">联系电话：</label>
            <input name="ss_shop_Phone" value="${store.ss_shop_Phone }" type="text" class="form_input " minlength="2"  required ><i class="i_start"></i></p>
        <p class="form_p"><label class="form_label">详细地址：</label>
            <input  name="ss_shop_Address" value="${store.ss_shop_Address }" type="text" class="form_input " minlength="2"  required ><i class="i_start"></i></p>
        <p class="form_p"><label class="form_label">建立时间：</label>
            <input name="ss_shop_Createtime" value="${store.ss_shop_Createtime }"  class="form_date" id="demo"/></p>
        <p class="form_p"><label class="form_label a_area">备注：</label><textarea name="ss_shop_Remarks" class="text_area1" >${store.ss_shop_Remarks}</textarea></p>



<div class="div_right">
    <p class="p_padd"><img src="/xiaozu/image/ph_list.png"/></p>
    <p class="p_padd"><input name="myImage" type="file" class="but_upload" value="点击上传图片"/></p>
    <p class="p_text1">上传图片格式为：jpg,png,tif,pneg,tiff格式。</p>
</div>
   <p class="but_p"><input type="button" onclick="toSubmit()" value="保存" class="but_save"/>
    <input type="button" value="取消" class="but_close" id="close"> </p>
</div>
</form>
<script src="/xiaozu/js/jquery.js"></script>

<script src="/xiaozu/js/date/js/laydate.js"></script>
<script src="/xiaozu/js/jquery-validation-1.14.0/dist/jquery.validate.min.js" charset="utf-8"></script>
<script src="/xiaozu/js/jquery-validation-1.14.0/dist/localization/messages_zh.js" charset="utf-8"></script>
<script>
    !function () {
        laydate.skin('danlan'); //
        laydate({ elem: '#demo' });
        laydate({ elem: '#demo1' });   //
    } ();

    $.validator.setDefaults({
        submitHandler: function () {
            alert("修改成功");
        }
    });
    $().ready(function () {
        $(".form_b").validate();
    });
</script>
</body>
</html>
